package com.tensquare.search.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;

/**
 * @Author:zimmor
 * @Date: 2021/3/6 16:50
 * @Description
 * @version: 1.0.0
 */
@Document(indexName = "articleIndex", type = "article")
public class Article implements Serializable {
    @Id
    private String id;
    //index是否索引的意思是：该字段或是说该域是否能被搜索
    //是否分词的意思是，意思是搜索的时候是单词匹配还是整体匹配
    //是否存储意思是,搜索的结果要不要显示到页面上
    //analyzer的意思是这个字段 存的时候用的分词器
    //searchAnalyzer的意思搜索的词用什么分词器
    @Field(index = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String title;
    @Field(index = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String content;
    private String state;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
